package com.eee.machine.exception;


import com.eee.machine.common.OperateResponse;
import com.eee.machine.common.ResponseResult;
import com.eee.machine.exception.bean.AccountFrozenException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionController {

    @ExceptionHandler(AccountFrozenException.class)
    @ResponseBody
    public OperateResponse accountFrozenException(AccountFrozenException ex){
        ex.printStackTrace();
        return new OperateResponse(ResponseResult.ACCOUNTFROZENERROR,ex.getMessage(),null);
    }

}
